package com.it.service;

import com.it.dao.TeacherDao;
import com.it.domain.Teacher;

import java.util.List;

public class TeacherService {
    // 创建dao对象
    private TeacherDao dao = new TeacherDao();

    // 判断id是否存在
    public boolean isExist(String id) {
        return dao.isExist(id);
    }

    // 添加老师
    public boolean addTeacher(Teacher Teacher) {
        // 调用dao层的方法
        return dao.add(Teacher);
    }

    // 查询全部老师信息
    public List<Teacher> findAll() {
        return dao.findAll();
    }

    //删除老师信息
    public boolean deleteTeacher(String id) {
        return dao.delete(id);
    }

    //更新老师信息
    public boolean updateTeacher(Teacher Teacher) {
        return dao.update(Teacher);
    }
}
